<!DOCTYPE html>
<html>
<head>
    <title>家校通</title>
    <meta name="keywords" content="" />
    <meta name="description" content="">
    <include file="public@head"/>
    <link rel="stylesheet" href="__STATIC__/js/jquery-ui/jquery-ui.css">

</head>
<body class="body-white" >
<include file="public@nav" />


<div class="container tc-main">
        <div class="col-md-3">
            <include file="public@jiaxiaonav" />
        </div>

        <div class="col-md-9">
            <!--标题 -->
            <div class="personal-nav" >
                <h2>添加孩子信息</h2>
            </div>
            <!--标题 -->

            <!--填写信息 -->
            <div class="fill-in wrap" >
                    <form action="{:url('jiaxiaotong/ChildrenInfo/addPost')}" method="post" class="form-horizontal js-ajax-form ">
                        <div class="fill-in-list">
                            <ul>
                                <li>
                                    <i>孩子姓名：</i>
                                    <span>
                                        <input type="text" name="name" placeholder="请输入学生姓名" class="srk" />
                                    </span>
                                </li>
                                <li>
                                    <i>性别：</i>
                                    <span>
                                        <select name="gender">
                                            <option value='0' selected>请选择性别</option>
                                            <option value='1'>男</option>
                                            <option value='2'>女</option>
                                        </select>
                                    </span>
                                </li>
                                <li>
                                    <i>出生日期：</i>
                                    <span>
                                        <input type="text"  name="birthday" class="srk" placeholder="请选择生日" autocomplete="off">
                                    </span>
                                </li>

                                <li>
                                    <i>年级：</i>
                                    <span>
                                        <select name="grade" id="grade">
                                            <option value="1">一年级</option>
                                            <option value="2">二年级</option>
                                            <option value="3">三年级</option>
                                            <option value="4">四年级</option>
                                            <option value="5">五年级</option>
                                            <option value="6">六年级</option>
                                            <option value="7">七年级</option>
                                            <option value="8">八年级</option>
                                            <option value="9">九年级</option>
                                            <option value="10">高一</option>
                                            <option value="11">高二</option>
                                            <option value="12">高三</option>
                                        </select>
                                    </span>
                                </li>
                                <li>
                                    <i>学校全称:</i>
                                    <span>
                                        <input type="text" name="school_name" placeholder="请输入学校全称" class="srk" id="school_name" />
                                    </span>
                                </li>
                                <li>
                                    <i>信息来源：</i>
                <span>
                        <input type="checkbox"  value="1" name="information_sources_type[]">学校推荐</input>
                    <input type="checkbox"  value="2" name="information_sources_type[]">老师推荐</input>
                    <input type="checkbox"  value="3" name="information_sources_type[]">学校官方</input>
                    <input type="checkbox"  value="4" name="information_sources_type[]">学校微信</input>
                    <input type="checkbox"  value="5"  name="information_sources_type[]">新闻媒体</input>
                    <input type="checkbox"  value="6" name="information_sources_type[]">信箱广告</input>
                    <input type="checkbox"  value="7" name="information_sources_type[]">同学推荐</input>
                    <input type="checkbox"  value="8" name="information_sources_type[]">朋友介绍</input>
                    <input type="checkbox"  value="9" name="information_sources_type[]">其他</input>
                </span>
                                </li>
                                <li id="information_sources_teacher" style="display:none">
                                    <i>老师：</i>
                  <span>

                <input type="text" class="srk"  name="information_sources_teacher" placeholder="请输入推荐老师名字" class="srk" />
                </span>
                                </li>
                                <li id="information_sources_student" style="display:none">
                                    <i>学生：</i>
                <span>
                     <input type="text" class="srk"  name="information_sources_student" placeholder="请输入推荐学生名字" class="srk" />
                </span>
                                </li>
                                <li id="information_sources_friend"  style="display:none">
                                    <i>朋友：</i>
                   <span>
                     <input type="text" class="srk"  name="information_sources_friend" placeholder="请输入推荐朋友名字" class="srk" />
                </span>
                                </li>
                                <li id="information_sources_other" style="display:none">
                                    <i>其他：</i>
                   <span>
                     <input type="text"  class="srk" name="information_sources_other" placeholder="请输入输入其他信息" class="srk" />
                </span>
                                </li>
                            </ul>
                        </div>

                        <!--确认提交 -->
                        <div class="fill-btn" style="margin-bottom:0;">
                            <ul>
                                <li>
                                    <button class="bm js-ajax-submit" type="submit">确定</button>
                                </li>
                            </ul>
                        </div>
                        <!--确认提交 -->
                    </form>
            </div>
        </div>
</div>
<!-- /container -->

<include file="public@footer" />
<include file="public@scripts" />
<script type="text/javascript" src="__STATIC__/js/jquery-ui/jquery-ui.min.js"></script>
<script type="text/javascript">
    $(document).ready(function() {
        $('input[name="birthday"]').datepicker({
//          changeMonth: true,
            changeYear: true
        });//日期

        $("body").on('change','#grade',function(){
            var myDate=new Date();
            $selected=$(this).find('option:selected').val();
            month=myDate.getMonth()+1;
            console.log(month);
            if($selected==6 && month>=7 )
            {
                $("#school_name").attr('placeholder','请输入初中学校名称');
            }else{
                $("#school_name").attr('placeholder','请输入学校全称');
            }
        })
        groupCheckbox = $("input[name='information_sources_type\[\]']");
        $("input[name='information_sources_type\[\]']").click(function(){
            for(i=0;i<groupCheckbox.length;i++){
                if(groupCheckbox[i].checked){
                    var val =groupCheckbox[i].value;
                    if(val==2)
                    { //老师
                        $("#information_sources_teacher").show();
                    }
                    if(val==7)
                    { //学生
                        $("#information_sources_student").show();
                    }
                    if(val==8)
                    { //朋友
                        $("#information_sources_friend").show();
                    }
                    if(val==9)
                    { //其他
                        $("#information_sources_other").show();
                    }
                }else{
                    var val =groupCheckbox[i].value;
                    if(val==2)
                    { //老师
                        $("#information_sources_teacher").hide();
                    }
                    if(val==7)
                    { //学生
                        $("#information_sources_student").hide();
                    }
                    if(val==8)
                    { //朋友
                        $("#information_sources_friend").hide();
                    }
                    if(val==9)
                    { //其他
                        $("#information_sources_other").hide();
                    }
                }
            }
        })

    });
</script>
</body>
</html>